<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>

		<link rel="stylesheet" href="css/food1.css" />
		<link rel="stylesheet" type="text/css" href="../common/css/meta.css"/>
		<link rel="stylesheet" href="css/reset.css" />
		<script src="js/jquery-1.9.1.js"></script>
		

		
		<script>
			function like(){
				//data是返回的信息
				/*$.post("/food/insertStrategy",{/!*id:stId*!/},function(data){
					if(data.state==1) {
						var curSt = data.value;
						$("#article_title").val(curSt.article_title);
						/!*$("#user_id").val(curSt._id);*!/*/


				/*	}
				});*/
			}
		</script>
	</head>
	<body>
		<div class="quan">
			<div class="nav">
				<a href="../index.html"><img src="../shop/img/images/back.png"/></a>
				<span class="word">文章详情</span>
			</div>
			<div class="main">
				<div class="mengban">
					<h4 id="article_title">珠珠的厨房By Fiona 早餐 午餐 下午茶</h4>
					<img src="img/24.jpg"/>
					<p>by Fiona 霓裳</p>
				</div>
			</div>
			<div class="body">
				<div class="content1">
					<div class="food_picture">
						<p>BY FIONA</p>
					</div>
					<img src="img/24.jpg" class="img" />
					<span class="food_span"><strong>Fiona 霓裳</strong></span>
					<span class="food_span1">9小时前</span>
					<span class="food_ji">20160918早！压力锅坏了没合成豆浆！只能吃<br/>别的了！今天是欧宝切片做了凯撒大帝 里面混合了面包订 
						<br/>那苏里拉奶酪 培根 包菜丝 蒜碎还有沙拉酱 抹在<br/>面包上进烤箱烤15分钟 味道非常好吃！<br/>比85°C还好吃呐！
					</span>
					
				</div>
				<div class="content1">
					<div class="food_picture0">
						<p>BY FIONA</p>
					</div>
					<img src="img/24.jpg" class="img" />
					<span class="food_span"><strong>Fiona 霓裳</strong></span>
					<span class="food_span1">10小时前</span>
					<span class="food_ji">20160918早！压力锅坏了没合成豆浆！只能吃<br/>别的了！今天是欧宝切片做了凯撒大帝 里面混合了面包订 
						<br/>那苏里拉奶酪 培根 包菜丝 蒜碎还有沙拉酱 抹在<br/>面包上进烤箱烤15分钟 味道非常好吃！<br/>比85°C还好吃呐！
					</span>
				</div>
				<div class="content1">
					<div class="food_picture1">
						<p>BY FIONA</p>
					</div>
					<img src="img/24.jpg" class="img" />
					<span class="food_span"><strong>Fiona 霓裳</strong></span>
					<span class="food_span1">10小时前</span>
					<span class="food_ji">20160918早！压力锅坏了没合成豆浆！只能吃<br/>别的了！今天是欧宝切片做了凯撒大帝 里面混合了面包订 
						<br/>那苏里拉奶酪 培根 包菜丝 蒜碎还有沙拉酱 抹在<br/>面包上进烤箱烤15分钟 味道非常好吃！<br/>比85°C还好吃呐！
					</span>
				</div>
				<div class="content1">
					<div class="food_picture2">
						<p>BY FIONA</p>
					</div>
					<img src="img/24.jpg" class="img" />
					<span class="food_span"><strong>Fiona 霓裳</strong></span>
					<span class="food_span1">10小时前</span>
					<span class="food_ji">20160918早！压力锅坏了没合成豆浆！只能吃<br/>别的了！今天是欧宝切片做了凯撒大帝 里面混合了面包订 
						<br/>那苏里拉奶酪 培根 包菜丝 蒜碎还有沙拉酱 抹在<br/>面包上进烤箱烤15分钟 味道非常好吃！<br/>比85°C还好吃呐！
					</span>
				</div>
				<div class="content1">
					<div class="food_picture3">
						<p>BY FIONA</p>
					</div>
					<img src="img/24.jpg" class="img" />
					<span class="food_span"><strong>Fiona 霓裳</strong></span>
					<span class="food_span1">10小时前</span>
					<span class="food_ji">20160918早！压力锅坏了没合成豆浆！只能吃<br/>别的了！今天是欧宝切片做了凯撒大帝 里面混合了面包订 
						<br/>那苏里拉奶酪 培根 包菜丝 蒜碎还有沙拉酱 抹在<br/>面包上进烤箱烤15分钟 味道非常好吃！<br/>比85°C还好吃呐！
					</span>
				</div>
				<div class="author">
				<img src="img/24.jpg" class="tou"/>
				<h5>霓裳</h5>
				<span>90后厨师</span>
			</div>
		</div>
			<input type="hidden" id = "user_id" name = "strategy_id">
		<div class="end" id="end" style="z-index: 101;">
				<img src="img/dianzan.png" class="zan" id="zan"/>
				<img src="img/pinglun.png" class="ping" id="pinglun"/>
				<span class="span1">评论</span>
				<span class="span" >点赞</span>
				
			</div>
		</div>





<script>
	$("#pinglun").click(function(){
		$(".comment_mengban").css("display","block");
	})
//------------------------------
	$(function() {
			register();
			init();
			function init() {
				initMainImage();

			}
			function initMainImage() {
				$("#tijiao").click(aaa)
			}
			function aaa(){
				var sendData = {userId:"午后阳光很温暖",comments:$("#comment_list").val().trim()};
				$.post("/hufu/pinglun",sendData,function(data) {
					if(data.state==2){

						$(".comment_mengban").css("display","none");
						alert("评论成功")
						window.location.href = "http://localhost:3000/suger/index2/food1.html";
					}else{
						alert("失败")
					}

				});
			}


			function register() {

		}

	})


	$(function(){
		showpinglun();
		function showpinglun(){
		 $.post("/hufu/comments",{},function(data){

			 for(var i = 0 ; i<data.value.length ; i++) {
				 var li = $("<li style='width: 90vw;word-wrap: break-word;margin-top:1rem;margin-left: 1rem;background-color: #fff'><p>"+parseInt(i+1)+"楼</p><h4>用户:<a href='#'>" + data.value[i].userId + "</a></h4><br>" + data.value[i].comments + "<br><br></li>");
				 $("#pinglist").append(li);


			 }

		 })
		 }
	})
</script>
		<h3 style="text-align: center">全部评论</h3>
		<ul id="pinglist" style="width: 100vw;height:auto; border: 1px solid #EFF1EB;position: relative;margin-bottom: 0rem;z-index: 1;background-color:#EFF1EB;">

		</ul>
		<h4 style="height: 3rem;line-height: 3rem; text-align: center;position: relative;margin-bottom: 3rem;background-color:#EFF1EB;"><a>更多</a></h4>

	<div class="comment_mengban" style="width: 100vw;height:15vh;position: fixed;bottom:3rem;border:1px solid blue;display: none;z-index: 102;background-color:#EFF1EB; ">
		<textarea id="comment_list" type="textarea"style="width: 80vw;height: 11vh;margin-left: 1rem;margin-top:2vh;"></textarea>
		<input id="tijiao" type="submit" value="提交">

	</div>
	</body>
</html>
